﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="shipping_area.aspx.cs" Inherits="WebSite.admin.shipping.shipping_area" %>
 
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>****后台管理系统</title>
    <link href="../main.css" rel="stylesheet" type="text/css" />
    <script language="javascript">
    parent.maintitle.innerHTML="管理中心";
	parent.contentmain.innerHTML="<span class='title01'>所在位置：</span> 配送方式 - 配送区域。&nbsp;&nbsp;<img src='images/sort_desc.gif' /> <a href='shipping/shipping_areadd<%=Request.QueryString["shippingid"]%>.aspx?shippingid=<%=Request.QueryString["shippingid"]%>' target='content'><font color=#ff0000>新建配送区域</font></a>"
    </script>
    <script language='javascript'>
        var path = (window.top.location).toString();
        if (path.indexOf('login.aspx') == -1) {
            if (path.indexOf('index.aspx') == -1) {
                window.top.location = 'index.aspx';
            }
        }
	</script>
<script type="text/javascript" language="javascript">
    function CheckSelect(del, str) {
        var rt = true;
        var num = 0;
        var boxorder = 0;
        var objCheckBox;
        for (var i = 0; i < form1.length; i++) {
            ///alert(form1.elements[i].type);
            if (form1.elements[i].type == "checkbox") {
                boxorder++;
                objCheckBox = form1.elements[i];
                ///alert(objCheckBox.checked);
                if (objCheckBox.checked) {
                    if (boxorder > 1) {
                        //如果是第一个CheckBox，是用来全选全消的，这个不算，不用自加
                        num++;
                    }
                }
            }
        }
        ///alert(num);
        if (!del) {
            if (num > 1) {
                alert("此操作不允许选择多个事件");
                rt = false;
            }
        }
        if (str == 'del') {
            if (num == 0) {
                alert("你没有选择要删除的信息");
                rt = false
            } else { return confirm('你确定要删除这些信息吗?'); }
            ///alert(rt);
        }
        else {
            if (str == 'update') {
                if (num == 0) {
                    alert("你没有选择要更新的信息");
                    rt = false
                } else { return confirm('你确定要更新这些信息吗?'); }
                ///alert(rt);
            } 
        }
        return rt;
    }

    function SelectAll(sa) {
        ///全选/全消
        var objCheckBox;
        for (var i = 0; i < form1.length; i++) {
            if (form1.elements[i].type == "checkbox") {
                objCheckBox = form1.elements[i];
                objCheckBox.checked = sa;
            }
        }
    }
</script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#F1F4F7">
<tr>
<td height="382" align="center" valign="top">
  <br />
  
  <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="areaid" Width="90%" OnRowDataBound="GridView1_RowDataBound" CellPadding="4" CellSpacing="1" ForeColor="#333333" GridLines="None">
           <Columns>                
                <asp:TemplateField ShowHeader="False" HeaderText="选择">
                 <ItemStyle Width="60px" Wrap="False" />
                 <HeaderTemplate>
                     <asp:CheckBox ID="CheckBox1" runat="server"></asp:CheckBox>
                 </HeaderTemplate>
                 <ItemTemplate>
                     <asp:CheckBox ID="CheckBox1" runat="server"></asp:CheckBox>
                 </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField HeaderText="配送区域名称" DataField="areaname" />
                <asp:BoundField HeaderText="所辖地区" DataField="area" />
                <asp:HyperLinkField DataNavigateUrlFields="areaid" DataNavigateUrlFormatString="shipping_areadd.aspx?shipareaid={0}" HeaderText="编辑" Text="编辑" />
                <asp:CommandField ShowDeleteButton="True" HeaderText="移除"  DeleteText="&lt;div id=&quot;de&quot; onclick=&quot;JavaScript:return confirm('你确定要移除?')&quot;&gt;移除&lt;/div&gt;" />               
                

            </Columns>
             <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />             
             <PagerStyle BackColor="White" ForeColor="#333333" HorizontalAlign="Center" Font-Bold="True" Font-Size=30px />
             <HeaderStyle BackColor="#E2E7EB" Font-Bold="True" ForeColor="Black" HorizontalAlign="Left" />
             <AlternatingRowStyle BackColor="White" />
    </asp:GridView>
<table width="90%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td height="40" align="left" valign="middle">&nbsp;
                    <asp:ImageButton ID="ImageButton1" ImageUrl="../images/button09.gif" runat="server" OnClick="ImageButton1_Click" /></td>
              </tr>
          </table>
</td>
</tr>
</table>
    </div>
    </form>
</body>
</html>
